﻿<UserControl x:Class="SolPowerTool.App.Controls.ProjectDetailControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:osc="clr-namespace:OpenSourceControls;assembly=DockPanelSplitter"
             xmlns:wpf="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
             xmlns:data="clr-namespace:SolPowerTool.App.Data"
             mc:Ignorable="d"
             d:DesignWidth="640"
             d:DesignHeight="480"
             d:DataContext="{d:DesignInstance Type=data:Project}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Resources/Resources.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Style TargetType="{x:Type osc:DockPanelSplitter}">
                <Setter Property="DockPanel.Dock"
                        Value="Top" />
                <Setter Property="ProportionalResize"
                        Value="True" />
                <Setter Property="Background"
                        Value="Black" />
                <Setter Property="BorderBrush"
                        Value="Black" />
                <Setter Property="Height"
                        Value="7" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Border BorderThickness="7"
            BorderBrush="LightBlue"
            CornerRadius="10"
            Background="LightGray"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Margin="7,7,7,12"
            Padding="7">
        <ScrollViewer HorizontalScrollBarVisibility="Auto"
                      VerticalScrollBarVisibility="Auto">
            <DockPanel LastChildFill="True">
                <StackPanel DockPanel.Dock="Top"
                            Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <Label Content="Project File:"
                               FontWeight="Bold" />
                        <Label Content="(ReadOnly)"
                               Visibility="{Binding IsReadOnly,Mode=OneWay,Converter={StaticResource booleanToVisibilityConverter}}" />
                    </StackPanel>
                    <TextBox Text="{Binding ProjectFilename,Mode=OneWay}"
                             IsReadOnly="True" />
                </StackPanel>

                <StackPanel DockPanel.Dock="Top"
                            Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <StackPanel>
                            <Label Content="Assembly name:"
                                   FontWeight="Bold" />
                            <TextBox Text="{Binding AssemblyName}" />
                        </StackPanel>
                        <StackPanel Margin="7,0,0,0">
                            <Label Content="Default namespace:"
                                   FontWeight="Bold" />
                            <TextBox Text="{Binding RootNamespace}" />
                        </StackPanel>
                        <StackPanel Margin="7,0,0,0">
                            <Label Content="Output type:"
                                   FontWeight="Bold" />
                            <TextBox Text="{Binding OutputType,Mode=OneWay}"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Margin="7,0,0,0">
                            <Label Content="Framework version:"
                                   FontWeight="Bold" />
                            <TextBox Text="{Binding TargetFrameworkVersion}"
                                     IsReadOnly="True" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>

                <Expander DockPanel.Dock="Top">
                    <Expander.Header>
                        <Label Content="Build configurations:"
                               FontWeight="Bold" />
                    </Expander.Header>
                    <wpf:DataGrid AutoGenerateColumns="False"
                                  ItemsSource="{Binding BuildConfigurationsView}"
                                  MinHeight="50">
                        <wpf:DataGrid.Columns>

                            <wpf:DataGridCheckBoxColumn Binding="{Binding IsSelected}"
                                                        Width="30" />
                            <wpf:DataGridTextColumn Header="Name"
                                                    Width="250"
                                                    IsReadOnly="True"
                                                    Binding="{Binding Name,Mode=OneWay}" />
                            <wpf:DataGridTextColumn Header="Normalized output path"
                                                    Width="250"
                                                    Binding="{Binding NormalizedOutputPath}"
                                                    CellStyle="{StaticResource dirtyColorStyle}" />
                            <wpf:DataGridCheckBoxColumn Header="CA"
                                                        Binding="{Binding RunCodeAnalysis}"
                                                        CellStyle="{StaticResource dirtyColorStyle}" />
                            <wpf:DataGridTextColumn Header="CA Ruleset"
                                                    Binding="{Binding RootedCodeAnalysisRuleSet}"
                                                    CellStyle="{StaticResource problemCodeAnalysisRuleSetColorStyle}" />
                        </wpf:DataGrid.Columns>
                    </wpf:DataGrid>

                </Expander>

                <osc:DockPanelSplitter />

                <Expander DockPanel.Dock="Top">
                    <Expander.Header>
                        <Label Content="References:"
                               FontWeight="Bold" />
                    </Expander.Header>
                    <wpf:DataGrid AutoGenerateColumns="False"
                                  ItemsSource="{Binding ReferencesView}"
                                  MinHeight="50"
                                  d:DataContext="{d:DesignInstance data:Reference}">
                        <wpf:DataGrid.Columns>
                            <wpf:DataGridCheckBoxColumn Binding="{Binding IsSelected}"
                                                        Width="30" />
                            <wpf:DataGridTextColumn Header="Name"
                                                    Width="150"
                                                    IsReadOnly="True"
                                                    Binding="{Binding Name,Mode=OneWay}" />
                            <wpf:DataGridTextColumn Header="Rooted HintPath"
                                                    Width="350"
                                                    CellStyle="{StaticResource problemHintPathColorStyle}"
                                                    Binding="{Binding RootedHintPath}" />
                            <wpf:DataGridTemplateColumn>
                                <wpf:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Content="Pick"
                                                Command="{Binding PickFileCommand}" />
                                    </DataTemplate>
                                </wpf:DataGridTemplateColumn.CellTemplate>
                            </wpf:DataGridTemplateColumn>

                            <wpf:DataGridTextColumn Header="Version"
                                                    IsReadOnly="True"
                                                    Binding="{Binding Version,Mode=OneWay}" />
                            <wpf:DataGridTextColumn Header="PKT"
                                                    IsReadOnly="True"
                                                    Binding="{Binding PublicKeyToken,Mode=OneWay}" />
                            <wpf:DataGridTemplateColumn Header="Version Fix">
                                <wpf:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Button Content="Look"
                                                    Command="{Binding PreviewAssemblyCommand}" />
                                            <Button Content="Load"
                                                    Command="{Binding LoadAssemblyCommand}" />
                                            <Button Content="Remove"
                                                    Command="{Binding RemoveAssemblyVersionCommand}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </wpf:DataGridTemplateColumn.CellTemplate>
                            </wpf:DataGridTemplateColumn>
                            <wpf:DataGridCheckBoxColumn Header="Specific Ver"
                                                        Width="100"
                                                        Binding="{Binding SpecificVersion}" />
                            <wpf:DataGridCheckBoxColumn Header="Copy local"
                                                        Width="75"
                                                        Binding="{Binding Private}" />
                            <wpf:DataGridTextColumn Header="Include"
                                                    Width="350"
                                                    IsReadOnly="True"
                                                    Binding="{Binding Include,Mode=OneWay}" />
                        </wpf:DataGrid.Columns>
                    </wpf:DataGrid>
                </Expander>

                <osc:DockPanelSplitter />

                <Expander DockPanel.Dock="Top">
                    <Expander.Header>
                        <Label Content="Project References:"
                               FontWeight="Bold" />
                    </Expander.Header>
                    <wpf:DataGrid AutoGenerateColumns="False"
                                  ItemsSource="{Binding ProjectReferencesView}"
                                  MinHeight="50"
                                  d:DataContext="{d:DesignInstance data:ProjectReference}">
                        <wpf:DataGrid.Columns>
                            <wpf:DataGridCheckBoxColumn Binding="{Binding IsSelected}"
                                                        Width="30" />
                            <wpf:DataGridTextColumn Header="Name"
                                                    Width="150"
                                                    IsReadOnly="True"
                                                    Binding="{Binding Name,Mode=OneWay}" />
                            <wpf:DataGridTextColumn Header="ProjectGuid"
                                                    Width="350"
                                                    Binding="{Binding ProjectGuid}" />

                            <wpf:DataGridTextColumn Header="Include"
                                                    Width="350"
                                                    IsReadOnly="True"
                                                    Binding="{Binding Include,Mode=OneWay}" />

                            <wpf:DataGridCheckBoxColumn Header="Missing"
                                                        IsReadOnly="True"
                                                        Binding="{Binding IsNotInSolution,Mode=OneWay}" />

                            <wpf:DataGridCheckBoxColumn Header="Wrong ID"
                                                        IsReadOnly="True"
                                                        Binding="{Binding HasIncorrectProjectGuid,Mode=OneWay}" />

                            <wpf:DataGridTextColumn Header="Path"
                                                    IsReadOnly="True"
                                                    CellStyle="{StaticResource problemMissingProjectFileColorStyle}"
                                                    Binding="{Binding RootedPath,Mode=OneWay}" />
                        </wpf:DataGrid.Columns>
                    </wpf:DataGrid>
                </Expander>

                <osc:DockPanelSplitter />

                <Expander DockPanel.Dock="Top">
                    <Expander.Header>
                        <Label Content="Pre-build event:"
                               FontWeight="Bold" />
                    </Expander.Header>
                    <TextBox Text="{Binding PreBuildEvent,Mode=OneWay}"
                             IsReadOnly="True"
                             VerticalScrollBarVisibility="Auto"
                             HorizontalScrollBarVisibility="Auto" />
                </Expander>

                <osc:DockPanelSplitter />

                <Expander DockPanel.Dock="Top">
                    <Expander.Header>
                        <Label Content="Post-build event:"
                               FontWeight="Bold" />
                    </Expander.Header>
                    <TextBox Text="{Binding PostBuildEvent,Mode=OneWay}"
                             IsReadOnly="True"
                             VerticalScrollBarVisibility="Auto"
                             HorizontalScrollBarVisibility="Auto" />
                </Expander>

                <osc:DockPanelSplitter />

                <Grid />
            </DockPanel>
        </ScrollViewer>
    </Border>

</UserControl>